#!/usr/bin/env python

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

f.add(from_string = 'Final geometry (xyz',
      num_lines = 8,
      abs_tolerance = 1.0e-3)
f.add(string = '@ Energy at final geometry is',
      abs_tolerance = 1.0e-7)
f.add(from_string = 'Gradient in cartesian coordinates',
      num_lines = 6,
      abs_tolerance = 1.0e-4)
f.add(from_string = 'Cartesian Hessian in GSPHES',
      num_lines = 24,
      abs_tolerance = 3.0e-4)
f.add(from_string = 'Dipole moment gradient (au)',
      num_lines = 18,
      abs_tolerance = 3.0e-4)
f.add(from_string = 'Vibrational Frequencies and IR Intensities',
      num_lines = 16,
      abs_tolerance = 2.0e-5,
      mask = [3])

test.run(['pehf_geoopt.dal'], ['water.mol'], ['14h2o.pot'], f={'out': f})

sys.exit(test.return_code)
